\(\int \tan ^3(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\) [199]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 82 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(2 a-b) b \tan ^4(e+f x)}{4 f}+\frac {b^2 \tan ^6(e+f x)}{6 f} \]

[Out]

(a-b)^2*ln(cos(f*x+e))/f+1/2*(a-b)^2*tan(f*x+e)^2/f+1/4*(2*a-b)*b*tan(f*x+e)^4/f+1/6*b^2*tan(f*x+e)^6/f

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 78} \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {b (2 a-b) \tan ^4(e+f x)}{4 f}+\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {b^2 \tan ^6(e+f x)}{6 f} \]

[In]

Int[Tan[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((a - b)^2*Log[Cos[e + f*x]])/f + ((a - b)^2*Tan[e + f*x]^2)/(2*f) + ((2*a - b)*b*Tan[e + f*x]^4)/(4*f) + (b^2
*Tan[e + f*x]^6)/(6*f)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^3 \left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \frac {x (a+b x)^2}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 f} \\ & = \frac {\text {Subst}\left (\int \left ((a-b)^2+(2 a-b) b x+b^2 x^2-\frac {(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f} \\ & = \frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(2 a-b) b \tan ^4(e+f x)}{4 f}+\frac {b^2 \tan ^6(e+f x)}{6 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.88 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {12 (a-b)^2 \log (\cos (e+f x))+6 (a-b)^2 \tan ^2(e+f x)+3 (2 a-b) b \tan ^4(e+f x)+2 b^2 \tan ^6(e+f x)}{12 f} \]

[In]

Integrate[Tan[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(12*(a - b)^2*Log[Cos[e + f*x]] + 6*(a - b)^2*Tan[e + f*x]^2 + 3*(2*a - b)*b*Tan[e + f*x]^4 + 2*b^2*Tan[e + f*
x]^6)/(12*f)

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.10

method result size
norman \(\frac {b^{2} \tan \left (f x +e \right )^{6}}{6 f}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {\left (2 a -b \right ) b \tan \left (f x +e \right )^{4}}{4 f}-\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}\) \(90\)
derivativedivides \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{6}}{6}+\frac {a b \tan \left (f x +e \right )^{4}}{2}-\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\frac {a^{2} \tan \left (f x +e \right )^{2}}{2}-\tan \left (f x +e \right )^{2} a b +\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) \(110\)
default \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{6}}{6}+\frac {a b \tan \left (f x +e \right )^{4}}{2}-\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\frac {a^{2} \tan \left (f x +e \right )^{2}}{2}-\tan \left (f x +e \right )^{2} a b +\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) \(110\)
parts \(\frac {a^{2} \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {b^{2} \left (\frac {\tan \left (f x +e \right )^{6}}{6}-\frac {\tan \left (f x +e \right )^{4}}{4}+\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {2 a b \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}\) \(125\)
parallelrisch \(-\frac {-2 b^{2} \tan \left (f x +e \right )^{6}-6 a b \tan \left (f x +e \right )^{4}+3 b^{2} \tan \left (f x +e \right )^{4}-6 a^{2} \tan \left (f x +e \right )^{2}+12 \tan \left (f x +e \right )^{2} a b -6 b^{2} \tan \left (f x +e \right )^{2}+6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2}-12 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a b +6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{2}}{12 f}\) \(130\)
risch \(-i a^{2} x +2 i a b x -i b^{2} x -\frac {2 i a^{2} e}{f}+\frac {4 i a b e}{f}-\frac {2 i b^{2} e}{f}+\frac {2 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}-8 a b \,{\mathrm e}^{10 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{10 i \left (f x +e \right )}+8 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+12 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-32 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+\frac {68 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}}{3}+8 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+2 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-8 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{6}}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a^{2}}{f}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a b}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b^{2}}{f}\) \(332\)

[In]

int(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/6*b^2*tan(f*x+e)^6/f+1/2*(a^2-2*a*b+b^2)/f*tan(f*x+e)^2+1/4*(2*a-b)*b*tan(f*x+e)^4/f-1/2*(a^2-2*a*b+b^2)/f*l
n(1+tan(f*x+e)^2)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.05 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 \, b^{2} \tan \left (f x + e\right )^{6} + 3 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{4} + 6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{12 \, f} \]

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/12*(2*b^2*tan(f*x + e)^6 + 3*(2*a*b - b^2)*tan(f*x + e)^4 + 6*(a^2 - 2*a*b + b^2)*tan(f*x + e)^2 + 6*(a^2 -
2*a*b + b^2)*log(1/(tan(f*x + e)^2 + 1)))/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (65) = 130\).

Time = 0.18 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.95 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {a b \tan ^{4}{\left (e + f x \right )}}{2 f} - \frac {a b \tan ^{2}{\left (e + f x \right )}}{f} - \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{2} \tan ^{6}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} + \frac {b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(tan(f*x+e)**3*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Piecewise((-a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**2/(2*f) + a*b*log(tan(e + f*x)**2 + 1)/f
+ a*b*tan(e + f*x)**4/(2*f) - a*b*tan(e + f*x)**2/f - b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b**2*tan(e + f*x)*
*6/(6*f) - b**2*tan(e + f*x)**4/(4*f) + b**2*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(a + b*tan(e)**2)**2*tan(e)*
*3, True))

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.55 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac {6 \, {\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \sin \left (f x + e\right )^{4} - 3 \, {\left (4 \, a^{2} - 14 \, a b + 9 \, b^{2}\right )} \sin \left (f x + e\right )^{2} + 6 \, a^{2} - 18 \, a b + 11 \, b^{2}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \]

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/12*(6*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2 - 1) - (6*(a^2 - 4*a*b + 3*b^2)*sin(f*x + e)^4 - 3*(4*a^2 - 14*
a*b + 9*b^2)*sin(f*x + e)^2 + 6*a^2 - 18*a*b + 11*b^2)/(sin(f*x + e)^6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 -
 1))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2205 vs. \(2 (76) = 152\).

Time = 4.15 (sec) , antiderivative size = 2205, normalized size of antiderivative = 26.89 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\text {Too large to display} \]

[In]

integrate(tan(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/12*(6*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 +
 1))*tan(f*x)^6*tan(e)^6 - 12*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + t
an(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 6*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(ta
n(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 6*a^2*tan(f*x)^6*tan(e)^6 - 18*a*b*tan(f
*x)^6*tan(e)^6 + 11*b^2*tan(f*x)^6*tan(e)^6 - 36*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(
f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 72*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(
f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 - 36*b^2*log(4*(tan(f*
x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5
+ 6*a^2*tan(f*x)^6*tan(e)^4 - 12*a*b*tan(f*x)^6*tan(e)^4 + 6*b^2*tan(f*x)^6*tan(e)^4 - 24*a^2*tan(f*x)^5*tan(e
)^5 + 84*a*b*tan(f*x)^5*tan(e)^5 - 54*b^2*tan(f*x)^5*tan(e)^5 + 6*a^2*tan(f*x)^4*tan(e)^6 - 12*a*b*tan(f*x)^4*
tan(e)^6 + 6*b^2*tan(f*x)^4*tan(e)^6 + 90*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*
tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 180*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*t
an(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 90*b^2*log(4*(tan(f*x)^2*t
an(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 6*a*
b*tan(f*x)^6*tan(e)^2 - 3*b^2*tan(f*x)^6*tan(e)^2 - 24*a^2*tan(f*x)^5*tan(e)^3 + 72*a*b*tan(f*x)^5*tan(e)^3 -
36*b^2*tan(f*x)^5*tan(e)^3 + 42*a^2*tan(f*x)^4*tan(e)^4 - 138*a*b*tan(f*x)^4*tan(e)^4 + 99*b^2*tan(f*x)^4*tan(
e)^4 - 24*a^2*tan(f*x)^3*tan(e)^5 + 72*a*b*tan(f*x)^3*tan(e)^5 - 36*b^2*tan(f*x)^3*tan(e)^5 + 6*a*b*tan(f*x)^2
*tan(e)^6 - 3*b^2*tan(f*x)^2*tan(e)^6 - 120*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^
2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 240*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)
*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 120*b^2*log(4*(tan(f*x)^
2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 2
*b^2*tan(f*x)^6 - 12*a*b*tan(f*x)^5*tan(e) + 18*b^2*tan(f*x)^5*tan(e) + 36*a^2*tan(f*x)^4*tan(e)^2 - 120*a*b*t
an(f*x)^4*tan(e)^2 + 90*b^2*tan(f*x)^4*tan(e)^2 - 48*a^2*tan(f*x)^3*tan(e)^3 + 144*a*b*tan(f*x)^3*tan(e)^3 - 7
2*b^2*tan(f*x)^3*tan(e)^3 + 36*a^2*tan(f*x)^2*tan(e)^4 - 120*a*b*tan(f*x)^2*tan(e)^4 + 90*b^2*tan(f*x)^2*tan(e
)^4 - 12*a*b*tan(f*x)*tan(e)^5 + 18*b^2*tan(f*x)*tan(e)^5 + 2*b^2*tan(e)^6 + 90*a^2*log(4*(tan(f*x)^2*tan(e)^2
 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 180*a*b*log
(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^2
*tan(e)^2 + 90*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan
(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 6*a*b*tan(f*x)^4 - 3*b^2*tan(f*x)^4 - 24*a^2*tan(f*x)^3*tan(e) + 72*a*b*tan(
f*x)^3*tan(e) - 36*b^2*tan(f*x)^3*tan(e) + 42*a^2*tan(f*x)^2*tan(e)^2 - 138*a*b*tan(f*x)^2*tan(e)^2 + 99*b^2*t
an(f*x)^2*tan(e)^2 - 24*a^2*tan(f*x)*tan(e)^3 + 72*a*b*tan(f*x)*tan(e)^3 - 36*b^2*tan(f*x)*tan(e)^3 + 6*a*b*ta
n(e)^4 - 3*b^2*tan(e)^4 - 36*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + ta
n(f*x)^2 + tan(e)^2 + 1))*tan(f*x)*tan(e) + 72*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*
x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)*tan(e) - 36*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*t
an(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)*tan(e) + 6*a^2*tan(f*x)^2 - 12*a*b*tan(
f*x)^2 + 6*b^2*tan(f*x)^2 - 24*a^2*tan(f*x)*tan(e) + 84*a*b*tan(f*x)*tan(e) - 54*b^2*tan(f*x)*tan(e) + 6*a^2*t
an(e)^2 - 12*a*b*tan(e)^2 + 6*b^2*tan(e)^2 + 6*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*
x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1)) - 12*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(
f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1)) + 6*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan
(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1)) + 6*a^2 - 18*a*b + 11*b^2)/(f*tan(f*x)^6*tan(e)^6 - 6*f*tan(f*x
)^5*tan(e)^5 + 15*f*tan(f*x)^4*tan(e)^4 - 20*f*tan(f*x)^3*tan(e)^3 + 15*f*tan(f*x)^2*tan(e)^2 - 6*f*tan(f*x)*t
an(e) + f)

Mupad [B] (verification not implemented)

Time = 11.29 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.18 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {a\,b}{2}-\frac {b^2}{4}\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6\,f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f} \]

[In]

int(tan(e + f*x)^3*(a + b*tan(e + f*x)^2)^2,x)

[Out]

(tan(e + f*x)^4*((a*b)/2 - b^2/4))/f - (log(tan(e + f*x)^2 + 1)*(a^2/2 - a*b + b^2/2))/f + (b^2*tan(e + f*x)^6
)/(6*f) + (tan(e + f*x)^2*(a^2/2 - a*b + b^2/2))/f